<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><neq name= '_title' value=''>{$_title} - {$site.site_name}<else />{$site.site_name} - {$site.site_slogan}</neq></title>
<meta content="<neq name= '_keywords' value=''>{$_keywords}<else />{$site.site_header_keywords}</neq>" name="keywords">
<meta content="<neq name= '_description' value=''>{$_description}<else />{$site.site_header_description}</neq>" name="description">
<meta name="viewport" charset="UTF-8" content="user-scalable=no"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<script src="__THEME__/js/jquery.js?v={$site.sys_version}"></script>
<link href="__THEME__/css/basic.css" rel="stylesheet" type="text/css">
<link href="__THEME__/css/common.css" rel="stylesheet" type="text/css">
<link href="__THEME__/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header">
    <div class="header_top">
        <div class="wrap">
            <div class="header_user"><img src="{:getUserFace($_SESSION['mid'])}">你好！{:getUserName($_SESSION['mid'])}
            <span class="line">|&nbsp;&nbsp;<a href="javascript:savepwd({$_SESSION['mid']});">修改密码</a>&nbsp;&nbsp;|</span><a href="{:U('public/Passport/logout')}">退出</a></div>
            <div class="header_logo">
                <if condition="$userGroup eq 1">健康平台</if>
                <if condition="$userGroup eq 2">市级健康平台</if>
                <if condition="$userGroup eq 3">区级健康平台</if>
                <if condition="$userGroup eq 4">园级健康平台</if>
                <if condition="$userGroup eq 5">班级健康平台</if>
            </div>
        </div>
    </div>
    <div class="header_bot">
        <div class="wrap">
            <ul class="header_nav">
                <li <php>if(MODULE_NAME == 'Report'){</php> class="on" <php>}</php>><a href="{:U('admin/Report/show_report_screen')}"><span class="icon-bggl"></span>报告管理</a></li>
                <li <php>if(MODULE_NAME == 'Resource'){</php> class="on" <php>}</php>><a href="{:U('admin/Resource/admin_show_resource')}"><span class="icon-zygl"></span>资源管理</a></li>
                <li <php>if(MODULE_NAME == 'Privilege'){</php> class="on" <php>}</php>><a href="{:U('admin/Privilege/index')}"><span class="icon-yhgl"></span>用户管理</a></li>
                <!-- <li <php>if(MODULE_NAME == 'Report'){</php> class="on" <php>}</php>><a href="{:U('admin/Report/screen')}"><span class="icon-dygl"></span>打印管理</a></li> -->
            </ul>
        </div>
    </div>
</div>
<div class="pop_wrap" id="update_pwd" style="display:none;">
  <div class="pop_box">
      <div class="pop_head"><a class="close" href="javascript:close();">X</a>用户密码修改</div>
        <div class="pop_body">
          <dl class="diapei_dl">
            <dl class="diapei_dl">
              <dt>新密码：</dt>
                <dd>
                    <input type="text" id="new_pwd">
                </dd>
            </dl>
        </div>
        <ul class="pop_foot">
            <input type="hidden" id="uid">
          <li><a href="javascript:close();">取消</a></li>
          <li><a href="javascript:doUpdateUserpwd();">确定</a></li>
        </ul>
    </div>
</div>
<script>
    function savepwd(id){
        $("#uid").val(id);
        $("#update_pwd").css("display","block");
    }
    function doUpdateUserpwd(){
       var uid=$("#uid").val();
       var pwd=$("#new_pwd").val();
       if(pwd==""){
            alert("请输入新密码");
            return;
       }
       $.ajax({
          type: "POST",
          url:"{:U('admin/Privilege/doUpdateUserPwd')}",
          data:"uid="+uid+"&pwd="+pwd,
          dataType:"text",
          success:function(data){
            if(isNaN(data)){
              alert(data);
            }else{  
                close();
                alert("修改成功，请重新登录！");
                window.location.href="{:U('public/Passport/logout')}";
            }
          }
        });
    }
    function close(){
        $("#uid").val("");
        $("#new_pwd").val("");
        $("#update_pwd").css("display","none");
    }
</script>